<?php

/**
 * CargoPayment form base class.
 *
 * @method CargoPayment getObject() Returns the current form's model object
 *
 * @package    symfony
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseCargoPaymentForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                    => new sfWidgetFormInputHidden(),
      'cargo_id'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cargo'), 'add_empty' => false)),
      'tatvar'                => new sfWidgetFormInputText(),
      'teewerleltzardal'      => new sfWidgetFormInputText(),
      'mongolia_gaalitatvar'  => new sfWidgetFormInputText(),
      'mongolia_hurtolzardal' => new sfWidgetFormInputText(),
      'payment_date'          => new sfWidgetFormInputText(),
      'create_at'             => new sfWidgetFormInputText(),
      'update_at'             => new sfWidgetFormInputText(),
      'enabled'               => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id'                    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'cargo_id'              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Cargo'))),
      'tatvar'                => new sfValidatorInteger(array('required' => false)),
      'teewerleltzardal'      => new sfValidatorInteger(array('required' => false)),
      'mongolia_gaalitatvar'  => new sfValidatorInteger(array('required' => false)),
      'mongolia_hurtolzardal' => new sfValidatorInteger(array('required' => false)),
      'payment_date'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'create_at'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'update_at'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'enabled'               => new sfValidatorBoolean(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('cargo_payment[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'CargoPayment';
  }

}
